const express = require('express');
const router = express.Router();
const systemSettingController = require('../controllers/systemSettingController');
const { authenticate, authorize } = require('../middlewares/auth');
const { authMiddleware } = require('../middleware/auth');

// 获取所有系统设置
router.get('/', authenticate, authorize(['admin']), systemSettingController.getAllSettings);

// 获取特定类别的系统设置
router.get('/:category', systemSettingController.getSettingsByCategory);

// 更新特定类别的系统设置
router.put('/:category', authenticate, authorize(['admin']), systemSettingController.updateSettings);

// 删除特定类别的系统设置
router.delete('/:category', authenticate, authorize(['admin']), systemSettingController.deleteSettings);

router.use(authMiddleware);

module.exports = router; 